import request from '@/content/utils/request'

//获得资源和课件
const getResAndCouesewareByLessonId = (data) => {
    return request({
        url: '/resource/getResAndCouesewareByLessonId',
        method: 'post',
        data,
    })
}

//获得pdf教案
const getNewTeachPlanByLessonId = (data) => {
    return request({
        url: '/resource/getNewTeachPlanByLessonId',
        method: 'post',
        data,
    })
}

const getQiniuUploadToken = (data) => {
    return request({
        url: '/resource/getQiniuUploadToken',
        method: 'post',
        data,
    })
}

const getResourceInfoByResIds = (data) => {
    return request({
        url: 'resource/getResourceInfoByResIds',
        method: 'post',
        data
    })
}

// 根据条件查找资源元的信息
const getCenterInfoByParam = (data) => {
    return request({
        url: 'resource/getCenterInfoByParam',
        method: 'post',
        data
    })
}

// 智能推荐
const getRecommendSource = (data) => {
    return request({
        url: 'resource/getRecommendSource',
        method: 'post',
        data
    })
}

const getUrlByThumbs = (data) => {
    return request({
        url: 'resource/getUrlByThumbs',
        method: 'post',
        data
    })
}

const getLessonVersion = (data) => {
    return request({
        url: '/lesson/getLessonVersion',
        method: 'post',
        data
    })
}

const getLessonPicByIds = (data) => {
    return request({
        url: '/lesson/getLessonPicByIds',
        method: 'post',
        data
    })
}

const getFourUpLessonIds = (data) => {
    return request({
        url: '/resource/getFourUpLessonIds',
        method: 'post',
        data
    })
}

const getMultiDocByLessonId = (data) => {
    return request({
        url: '/resource/getMultiDocByLessonId',
        method: 'post',
        data
    })
}

const createUserDownloadInfoRecord = (data) => {
    return request({
        url: '/usermeta/createUserDownloadInfoRecord',
        method: 'post',
        data
    })
}

//保存用户课程下资源排序信息
const saveUserLesResSort = (data) => {
    return request({
        url: '/resource/saveUserLesResSort',
        method: 'post',
        data
    })
}

//保存用户课程下资源排序信息
const queryUserLesResSort = (data) => {
    return request({
        url: '/resource/queryUserLesResSort',
        method: 'post',
        data
    })
}


//保存用户课程下资源排序信息
const deleteUserLesResSort = (data) => {
    return request({
        url: '/resource/deleteUserLesResSort',
        method: 'post',
        data
    })
}

//查询资源搜索关键词标签列表
const queryKeyWordTags = (data) => {
    return request({
        url: '/resource/queryKeyWordTags',
        method: 'post',
        data
    })
}

const getUserSpace = (data) => {
    return request({
        url: '/usermeta/getUserSpace',
        method: 'post',
        data
    })
}

const getAllUploadFile = (data) => {
    return request({
        url: '/usermeta/getAllUploadFile',
        method: 'post',
        data
    })
}

const deleteUserUploadFile = (data) => {
    return request({
        url: '/usermeta/deleteUserUploadFile',
        method: 'post',
        data
    })
}

const getUserLessonVer = (data) => {
    return request({
        url: '/usermeta/getUserLessonVer',
        method: 'post',
        data
    })
}

const createUserBatchFiles = (data) => {
    return request({
        url: '/usermeta/createUserBatchFiles',
        method: 'post',
        data
    })
}

//获取用户自定义课程资源元信息
const queryDiyLessonFile = (data) => {
    return request({
        url: '/resource/queryDiyLessonFile',
        method: 'post',
        data,
    })
}

//根据输入查询相关关键词
const getSimilarWord = (data) => {
    return request({
        url: '/resource/getSimilarWord',
        method: 'post',
        data,
    })
}

export default {
    getResAndCouesewareByLessonId,
    getQiniuUploadToken,
    getResourceInfoByResIds,
    getCenterInfoByParam,
    getRecommendSource,
    getUrlByThumbs,
    getLessonVersion,
    getLessonPicByIds,
    getFourUpLessonIds,
    getMultiDocByLessonId,
    createUserDownloadInfoRecord,
    getNewTeachPlanByLessonId,
    saveUserLesResSort,
    queryUserLesResSort,
    deleteUserLesResSort,
    queryKeyWordTags,
    getUserSpace,
    getAllUploadFile,
    deleteUserUploadFile,
    getUserLessonVer,
    createUserBatchFiles,
    queryDiyLessonFile,
    getSimilarWord,
}
